Add button next to ADD TO CART on product archive

120

add_action('woocommerce_after_shop_loop_item', 'add_a_custom_button_apply', 1 );
function add_a_custom_button_apply() {
    global $product;

    // Not for variable and grouped products that doesn't have an "add to cart" button
    if( $product->is_type('variable') || $product->is_type('grouped') ) return;

    // Output the custom button linked to the product
    echo '<a class="button custom-button apply-now" href="../act-now/apply-now">' . __('Apply Now') . '</a>';
}

Comments

Submit
0 Comments